#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>

int main()
{
	/**/
	int l_iFifo;
	int l_iData = 0;

	l_iFifo = open("/tmp/fifo_ac",O_RDWR);
	if(l_iFifo < 0)
	{
		printf("Unable to open FIFO, exiting..\n");
		return -1;
	}

	//Check opening of fifo is successful
	for(l_iData = 0 ; l_iData < 10 ; l_iData++)
	{
		read(l_iFifo,&l_iData,sizeof(int));
		printf("Read %d from fifo!\n",l_iData);
		sleep(1);
	}
	return 0;
} 
